let date = new Date()
//获取年月日
let y = date.getFullYear().toString()
let m = (date.getMonth() + 1).toString()
let d = date.getDate().toString()

//获取时分秒
var hour = date.getHours();//获取系统时间
var minute = date.getMinutes(); //分
var second = date.getSeconds();//秒

console.log("现在的时间是"+y+"年"+m+"月"+d+"日"+hour+":"+minute+":"+second)